package com.sky.dto;

import com.sky.entity.SetmealDish;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import javax.validation.Valid;
import javax.validation.constraints.NotEmpty;
import javax.validation.constraints.NotNull;
import java.io.Serializable;
import java.math.BigDecimal;
import java.util.ArrayList;
import java.util.List;

/**
 * 新增套餐 就收数据的 dto
 */
@Data
@ApiModel(value = "SetmealDTO", description = "新增套餐接收数据的模型")
public class SetmealDTO implements Serializable {

    @ApiModelProperty(value = "主键值")
    private Long id;

    //分类id
    @ApiModelProperty(value = "分类id", required = true)
    @NotNull(message = "套餐分类id为空")
    private Long categoryId;

    //套餐名称
    @ApiModelProperty(value = "套餐名称", required = true)
    @NotNull(message = "套餐名称为空")
    private String name;

    //套餐价格
    @ApiModelProperty(value = "套餐价格", required = true)
    @NotNull(message = "套餐价格为空")
    private BigDecimal price;

    //状态 0:停用 1:启用
    @ApiModelProperty(value = "状态 0:停用 1:启用")
    private Integer status;

    //描述信息
    @ApiModelProperty(value = "描述信息")
    private String description;

    //图片
    @ApiModelProperty(value = "图片", required = true)
    @NotNull(message = "套餐图片为空")
    private String image;

    //套餐菜品关系
    @ApiModelProperty(value = "套餐菜品关系")
    @Valid  //嵌套校验
    @NotEmpty(message = "未选择菜品数据")
    private List<SetmealDish> setmealDishes = new ArrayList<>();

}
